/**
* 我的君元宝
* 链接：this.$router.push({path:'/task'})
*/

<template>
  <div class="situation x-bg tasks">
    <header-top :option="headerOption"></header-top>
    <div class="overview">
      <Overview></Overview>
    </div>
    <div class="wave">
      <img src="~assets/images/bowen@3x.png" width="100%" height="40px">
    </div>
    <div class="rookie">
      <div class="headline">
        <span></span>新手任务
      </div>
      <Options :tasks="noviceTasks"></Options>
    </div>
    <div class="routine">
      <div class="headline">
        <span></span>常规任务
      </div>
      <Options :tasks="routineTasks"></Options>
    </div>
  </div>
</template>

<script>
  import Constant from 'common/constant'
  import LocalDAO from 'common/localDAO'
  import RemoteDAO from 'common/remoteDAO'
  import HeaderTop from 'components/HeaderTop'
  import Overview from 'components/dynamic/tasks/Overview'
  import Options from 'components/dynamic/tasks/Options'
  export default {
    data () {
      return {
        headerOption: {
          title: '我的君元宝',
          leftBtn: Constant.leftBtn.BACK,
          operations: [Constant.operation.REFRESH]
        },
        noviceTasks: [],
        routineTasks: []
      }
    },
    components: {
      HeaderTop,
      Overview,
      Options
    },
    created () {
      this.getNoviceTasks();
      this.getRoutineTasks();
    },
    methods: {
      //获取新手任务列表
      getNoviceTasks () {
        let object = {};
        object.config_type = "NRNGXSRW";
        RemoteDAO.callUC12000048(object, response => {
          this.noviceTasks = response.data.body;
        })
      },

      //获取常规任务列表
      getRoutineTasks () {
        let object = {};
        object.config_type = "NRNGCGRW";
        RemoteDAO.callUC12000048(object, response => {
          this.routineTasks = response.data.body;
        })
      }
    }
  }
</script>
